package com.example.servicefeign.interceptor;


import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.slf4j.MDC;
import org.springframework.stereotype.Component;

@Component
public class RequestTraceChainInterceptor implements RequestInterceptor {

    @Override
    public void apply(RequestTemplate requestTemplate) {
        String traceId = MDC.get("traceId");
        requestTemplate.header("traceId", traceId);
    }
}